<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        background-color: rgb(183, 185, 187);
        border: 1px solid skyblue;
        /* 设置当前视距为800px，是人眼到屏幕的距离 ,写在body中即可*/
        perspective: 800px;
      }
      .box {
        width: 100px;
        height: 100px;
        background-color: #bfa;
        margin: 200px auto;
        transition: 2s;
      }
      /* 
        z平移转近大远小，网页默认不支持透视，需要开启视距，才有效果
      */
      body:hover .box {
        transform: translateZ(-200px);
      }
    </style>
  </head>
  <body>
    <div class="box"></div>
  </body>
</html>
